<template>
  <!--  车间管理下拉框完结！ TODO：测试通过 样式未调试-->
  <el-select v-model="id" @change="changes" placeholder="请选择">
    <el-option v-for="item in options"  :key="item.id" :label="item.name" :value="item.id">
    </el-option>
  </el-select>
</template>
<script>
export default {
  name: "GongQuSelect",
  data() {
    return {
      id: '',
      options: []
    }
  },
  methods:{
    async init(cheJianId){
      const url = 'api/user/listGong?cheJianId='+cheJianId;
      const that = this;
      let result = await this.$http.get(url)
      that.options = result.data.data.list
    },
    changes(val){
      this.$emit('gongQuSelect',val);
    },
    clear(){
      this.id = ''
    },
    select(id){
      this.id = id
    }
  }
}
</script>

<style lang="less" scoped>

</style>
